﻿<!DOCTYPE html>
<!--承包商违规签字预览-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>
<body>
    <div id="app" v-cloak class="popupW100">
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px"
                 size="mini">
            <el-row>

                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.ContractorName" autocomplete="off" size="mini" :disabled="true">
                                <template slot="prepend">
                                    {{ContractorViolationAccount.ContractorName+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>

                <el-col :span="11" :offset="2">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.Violators" autocomplete="off" size="mini" :disabled="true">
                                <template slot="prepend">
                                    {{ContractorViolationAccount.Violators+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>

                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.DiscoveringPeople" autocomplete="off" size="mini":disabled="true">
                                <template slot="prepend">
                                    {{ContractorViolationAccount.DiscoveringPeople+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" :offset="2">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    <div> {{ContractorViolationAccount.IsBlacklist+mark.m}}</div>
                                </template>
                                <el-select @visible-change="visibleChange" v-model="Form.IsBlacklist" slot="suffix" :placeholder="ContractorViolationAccount.IsBlacklist" disabled>
                                    <el-option label="请选择" value=""></el-option>
                                    <el-option v-for="item in IsBlacklist" :label="item.value" :value="item.key">
                                    </el-option>
                                </el-select>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item :label="ContractorViolationAccount.ViolationDate+mark.m" class="inputTextarea">
                        <el-date-picker v-model="Form.ViolationDate"
                                        type="date"
                                        placeholder="选择日期" disabled>
                        </el-date-picker>
                    </el-form-item>
                </el-col>            
            </el-row>
            <el-row>
                <el-form-item :label="ContractorViolationAccount.ViolationClause+mark.m" prop="ViolationClause">
                    <el-input type="textarea" v-model="Form.ViolationClause" autocomplete="off" :disabled="true"></el-input>
                </el-form-item>
            </el-row>
            <el-row>
                <el-form-item :label="ContractorViolationAccount.ViolationInstructions+mark.m" prop="ViolationInstructions">
                    <el-input type="textarea" v-model="Form.ViolationInstructions" autocomplete="off" :disabled="true"></el-input>
                </el-form-item>
            </el-row>
            <el-row>
                <el-form-item :label="ContractorViolationAccount.ProcessingOpinion+mark.m" prop="ProcessingOpinion">
                    <el-input type="textarea" v-model="Form.ProcessingOpinion" autocomplete="off" :disabled="true"></el-input>
                </el-form-item>
            </el-row>
            <el-row>
                <el-form-item :label="ContractorViolationAccount.Remarks+mark.m" prop="Remarks">
                    <el-input type="textarea" v-model="Form.Remarks" autocomplete="off" :disabled="true"></el-input>
                </el-form-item>
            </el-row>

            <el-row>
                <el-form-item :label="ContractorViolationAccount.ContractorQZ+mark.m" prop="ContractorQZ">
                    <el-input type="text" v-model="Form.ContractorQZ" autocomplete="off" :disabled="true"></el-input>
                </el-form-item>
            </el-row>

            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">打印</el-button>
                </el-form-item>

            </el-row>
        </el-form>

    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                id: '',
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    ContractorName: '',
                    ViolationDate: '',
                    ViolationInstructions: '',
                    Violators: '',
                    ViolationClause: '',
                    DiscoveringPeople: '',
                    ProcessingOpinion: '',
                    IsBlacklist: '',
                    Remarks: '',
                    ContractorQZ:'',
                },

                IsBlacklist: [],
                //表单验证
                rules: {
                    Violators: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(2, 5), message: verification.StringLengthAtoB.m.format(2, 5), trigger: 'blur' }
                    ],
                    DiscoveringPeople: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(2, 5), message: verification.StringLengthAtoB.m.format(2, 5), trigger: 'blur' }
                    ],
                    ContractorName: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 50), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    ViolationDate: [
                        verification.NotNull
                    ],
                    IsBlacklist: [
                        verification.NotNull
                    ]
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/ContractorViolation/Agreed', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
               
                getData: function () {
                    getData(this, '/api/ContractorViolation/get?id=' + this.id);
                }
            },
            mounted: function () {
                this.IsBlacklist = getDicData('50');
                this.id = getUrlParam("id");
                this.getData();
            }
        });
    </script>
</body>

</html>